<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
                <title></title>
                <link rel="stylesheet" href="__PUBLIC__/Css/bootstrap.min.css" />
                <link rel="stylesheet" href="__PUBLIC__/Css/common.css" />
                <jquery/>
                <script type="text/javascript" src='__UPLOADIFY__/jquery.uploadify.js'></script>
                </style> 
        </head>
        <body>
                <div class="container-fluid">
                        <div class="row-fluid">
                                <div class="span12">

                                        <form action="" method='post' >
                                                <fieldset>
                                                        <legend>编辑商品品牌</legend>
                                                        <table class="table table-bordered table-hover">
                                                                <tr class="info">
                                                                        <td>品牌名称</td>
                                                                        <td colspan="2">
                                                                                <input type="text" name='bname' value='{$data.bname}'/>
                                                                        </td>
                                                                </tr>
                                                                <tr class="info">
                                                                        <td>品牌所属类型</td>
                                                                        <td colspan="2">
                                                                                <select name='type_tid'>
                                                                                        <option value="0">-----------请选择-----------</option>
                                                                                        <foreach from='$Type' value='$v'>
                                                                                                <option value="{$v.tid}" <if value='$v.tid eq $data.type_tid'>selected="selected"</if>>{$v.tname}</option>
                                                                                        </foreach>
                                                                                        
                                                                                </select>
                                                                        </td>
                                                                </tr>
                                                                <tr class="info">
                                                                        <td>品牌LOGO</td>
                                                                        <td>
                                                                                <upload  name='logo' alt="false" water="false" limit='1' waterbtn="false" dir="upload/logo/" width="98" height="35" size="1" data='$logo'/>
                                                                                <span style='color:#C81522;font-size:14px;font-family: Verdana,宋体,arial;'>*********logo建议尺寸98*35*********</span>
                                                                        </td>
                                                                </tr>
                                                                <tr class="info">
                                                                        <td>是否热门</td>
                                                                        <td colspan="2">
                                                                                <input type="radio" name='is_hot' value='1' id="hot" <if value='$data.is_hot eq 1'>checked="checked"</if>/>
                                                                                <label for="hot">是</label>
                                                                                <input type="radio" name='is_hot' value='0' id="nothot" <if value='$data.is_hot eq 0'>checked="checked"</if>/>
                                                                                <label for="nothot">否</label>
                                                                        </td>
                                                                </tr>
                                                                <tr class="info">
                                                                        <td>排序</td>
                                                                        <td colspan="2">
                                                                                <input type="text" name='sort' value="{$data.sort}"/>
                                                                        </td>
                                                                </tr>
                                                                <tr>
                                                                        <td colspan='3' align='center'>
                                                                                <input type="hidden" name="bid" value="{$data.bid}" />
                                                                                <input type="submit" class="btn btn-primary" value="修改品牌" />
                                                                        </td>
                                                                </tr>
                                                        </table>
                                                </fieldset>
                                        </form>

                                </div>
                        </div>
                </div>

                <script type="text/javascript">
                        $(function() {
                                $("#logo").uploadify({
                                        fileTypeDesc: '请选择LOGO图片',
                                        uploadLimit: 1,
                                        fileTypeExts: '*.gif; *.jpeg; *.jpg; *.png',
                                        buttonImage: '__UPLOADIFY__/btn.png',
                                        width: 120,
                                        height: 30,
                                        swf: '__UPLOADIFY__/uploadify.swf',
                                        uploader: '{:U("upload")}',
                                        //解决某些浏览器(主要是FF)Uploadify上传时丢失SESSION问题
                                        formData: {'<?php echo session_name();?>': '<?php echo session_id();?>'},
                                        onUploadSuccess: function(file, data, response) {
                                                eval('data=' + data);
                                                if (data.status == 1) {
                                                        var str = '<img src="__UPLOAD__/Logo/' + data.name + '" width="100" height="100" />';
                                                        str += '<input type="hidden" name="logo" value="' + data.name + '"/>';
                                                        $('#logo-wrap').empty().append(str).fadeIn(2000);
                                                } else {
                                                        alert(data.msg);
                                                }
                                        }
                                });
                        });
                </script>
        </body>
</html>